After everything was working alright I shelved the whole thing for a couple of weeks.
Then I started working on the diagram printing mechanism.
This is rather straightforward and the entire printing code is included in the file
diagrams.c. It contains the functions
One word concerning cropping in diagram: you could interpret cropping as simply
removing parts of the diagram but keeping the position unchanged. I thought this was the
way it was supposed to be at first but DVIview simply moves the entire image so I
added support for this mode as well; define CROP_MODE_DVIVIEW and you'll get
cropping like in DVIview otherwise the other variety is selected. The binary included
in this release was compiled with CROP_MODE_DVIVIEW defined.